package com.qdc.datacenters.domain.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.util.Date;


/**
 * 会话消息(ChatContactMsg)表实体类
 *
 * @author danmo
 * @since 2024-02-28 17:24:23
 */
@EqualsAndHashCode(callSuper = true)
@Schema
@Builder
@Data
@SuppressWarnings("serial")
@TableName("chat_contact_msg")
public class ChatContactMsg extends BaseEntity implements Serializable {
    private static final long serialVersionUID = 140047427996563537L;

    /**
     * 主键id
     */

    @Schema(description = "主键id")
    @TableId(type = IdType.AUTO)
    private Long id;


    /**
     * 消息id
     */
    @Schema(description = "消息id")
    @TableField("msg_id")
    private String msgId;

    /**
     * 发送人id
     */
    @Schema(description = "发送人id")
    @TableField("from_id")
    private String fromId;

    /**
     * 接收人id（列表）
     */
    @Schema(description = "接收人id（列表）")
    @TableField("to_list")
    private String toList;

    /**
     * 群聊id
     */
    @Schema(description = "群聊id")
    @TableField("room_id")
    private String roomId;

    /**
     * 消息类型
     */
    @Schema(description = "消息类型")
    @TableField("action")
    private String action;


    /**
     * 消息类型(如：文本，图片)
     */
    @Schema(description = "消息类型(如：文本，图片)")
    @TableField("msg_type")
    private String msgType;


    /**
     * 发送时间
     */
    @Schema(description = "发送时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @TableField("msg_time")
    private Date msgTime;


    /**
     * 消息标识
     */
    @Schema(description = "消息标识")
    @TableField("seq")
    private Long seq;


    /**
     * 文本消息
     */
    @Schema(description = "文本消息")
    @TableField("msg_text")
    private String msgText;


    /**
     * 消息内容
     */
    @Schema(description = "消息内容")
    @TableField("content")
    private String content;

    /**
     * 状态 1-未处理 2-已处理
     */
    @Schema(description = "状态 1-未处理 2-已处理")
    @TableField("status")
    private Integer status;


    @Schema(description = "会话类型 1-单聊 2-群聊")
    @TableField("chat_type")
    private Integer chatType;

    @Schema(description = "聊天类型 1-外部 2-内部")
    @TableField("relation_type")
    private Integer relationType;

    @Schema(description = "消息来源 3-客户 4-系统 5-员工")
    @TableField("origin")
    private Integer origin;

}

